package model.autolight.sequential;

import framework.common.SingleSensor;

public class LEDSensor extends SingleSensor {

	@Override
	public Object getAttribute(String attr) {
		if (attr.equals("LED")) {
			Object value = super.getAttribute(attr);
			System.out.println(getName() + " read " + attr + " " + ((Integer)value).intValue());
			return value;
		}
		throw new RuntimeException("no such attribute");
	}

	@Override
	public void setAttribute(String attr, Object value) {
		if (attr.equals("LED")) {
			System.out.println(getName() + " write " + attr + " " + ((Integer)value).intValue());
			super.setAttribute(attr,  value);
			return;
		}
		throw new RuntimeException("no such attribute");
	}

}
